﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using BlueCMS.Core.Data.Query.Clauses;

namespace BlueCMS.Core.Data.Query.Columns
{
    public class SelectColumn : Column, ISelectColumn
    {
        public SelectType Type { get; set; }
        public string Alias { get; set; }
        SelectClause Clause { get; set; }

        public SelectColumn(object nameOrExpression, SelectType type, SelectClause clause)
            : base(nameOrExpression)
        {
            Clause = clause;
            Type = type;
        }

        public ISelectClause As(string alias)
        {
            Alias = alias;
            return Clause;
        }
    }
}
